<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="x-ua-compatible" content="chrome-1 ie=edge">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width">
        <title>登录</title>
        {% load static %}
        <link rel="stylesheet" href="{% static 'css/login_v3.css' %}">
            <!-- jQuery -->
        <script src="{% static 'js/jquery-3.5.1.min.js' %}"></script>
        <script src="{% static 'js/jquery.form.min.js' %}"></script>
            <!--Layui-->
        <script src="{% static 'plugins/layui/layui.js' %}"></script>

    </head>
    <body>
        <div id="root">
            <div class="account-wrapper">
                <div class="account-container">
                    <div class="account-header" style="height: 100px;">
                        <h1>工资条管理系统</h1>
                    </div>
                    <div class="mobile-account-header">
                        <a class="mobile-account-header-logo"></a>
                    </div>

                    <div class="account-content account-normal-login">
                        <form id="put" action="" id="form_login" method="post">
                            {% csrf_token %}
                        <div class="account-section-title">
                            <div class="account-section-title-content">
                                <p class="account-section-title-text">绑定账号</p>
                            </div>
                            <a href="{% url 'login:recover_password' %}"><button type="button" class="next-btn next-medium next-btn-normal next-btn-text normal-forgot">忘记密码</button></a>
                        </div>
                        <div class="linear-input account-input">
                            <input class="linear-input-instance" name="username" placeholder="手机号/工作邮箱/用户名">
                        </div>
                        <div class="suffix-password">
                            <div class="linear-input account-input">
                                <input class="linear-input-instance" name="password" type="password" placeholder="密码" autocomplete="on">
                                <div class="linear-input-extra-icon">
                                    <i class="next-icon next-icon-eye-slash next-medium">
                                    <svg viewBox="0 0 1024 1024">
                                        <use xlink:href="#at-eye-slash"></use>
                                    </svg>
                                    </i>
                                </div>
                            </div>
                        </div>
                    <button type="submit" class="next-btn next-medium next-btn-primary account-btn">登录</button>
                    </form>
                </div>
            </div>
        </div>
        </div>
<div style="text-align: center; height: 60px; line-height: 60px; position: absolute;bottom: 0; font-size: 12px; color: rgb(153, 153, 153); width: 100%;">
    Copyright © 2020-2099 Stronggg. All rights reserved.
</div>
<div style="text-align: center; height: 60px; line-height: 60px; position: absolute; bottom: 20px; font-size: 12px; color: rgb(153, 153, 153); width: 100%;">
    <a href="https://beian.miit.gov.cn/" style="text-decoration: none;color: grey">粤ICP备20054981号-1 </a>
</div>
</body>
<script>
//post提交的csrf认证
$.ajaxSetup({
    data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
});
 // 提交，FORM  ID
$("#put").submit(function () {
    var options = {
        success: showRespone,  //ajaxForm提交成功后，执行函数
        resetForm: false,      //执行完毕后是否重设表单
        datetype: 'json',      //数据类型
    }
    $("#put").ajaxSubmit(options);
    return false;
})

function showRespone(data) {
    if(data.status === 1){
        //操作成功
        layui.use('layer',function () {
            var layer=layui.layer;
            info = data.info
            pid = data.pid
            layer.alert(info,{
                icon: 6,
                btn: '确定',
                skin: 'layer-ext-moon',
                yes: function () {
                    //完成后跳转评价二维码展示，带id转
                    // 企业微信
                    console.log({{ tpye_ }})
                    console.log(typeof({{ tpye_ }}))
                    {% if type_ == "ent_wechat" %}
                        location.href = "{% url 'login:ent_wechat_login' %}";
                    {% elif type_ == "dingtalk" %}
                        //钉钉
                        location.href = "{% url 'login:ent_wechat_login' %}";
                    {% else %}
                        location.href = "{% url 'login:auth' %}";
                    {% endif %}
                },
            })
        })
    }else {
        //操作失败
        layui.use('layer',function () {
            var layer=layui.layer;
            info = data.info
            layer.alert(info,{
                icon: 5,
                skin: 'layer-ext-moon',
            })
        })
    }
}
</script>
<script>
    function alert1() {
        alert('未开放！')
    }
</script>
</html>


